/**
 * Created by zhangjinrui on 17/6/27.
 */

public class Solution334VeryGood {

    public static void main(String args[]){
        Solution334VeryGood s = new Solution334VeryGood();
        System.out.println(s.increasingTriplet(new int[]{2, 3, 1, 4}));
    }

    public boolean increasingTriplet(int[] nums) {
        int small1 = Integer.MAX_VALUE;
        int small2 = Integer.MAX_VALUE;
        for(int n : nums){
            if(n <= small1){
                small1 = n;
            }else if(n <= small2){
                small2 = n;
            }else{
                return true;
            }
        }
        return false;
    }
}
